package com.jamie.account.service;

import com.jamie.account.domain.Account;
import com.jamie.account.mapper.AccountMapper;
import com.jamie.api.account.AccountService;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Jamie
 * @date 2020/4/13
 */
@RestController
public class AccountServiceImpl implements AccountService {
    @Resource
    private AccountMapper accountMapper;

    @Override
    public void debit(String userId, int money) {
        Account account = new Account();
        account.setUserId(userId);
        account.setMoney(money);
        accountMapper.insert(account);
    }
}
